<?php

// phpMyRealty 3
//
// File Name: compare.php
// File Location : ./
//
// Copyright (c)2009 phpMyRealty.com
//
// e-mail: support@phpMyRealty.com

// Include configuration file and general functions
define('PMR', 'true');

$page = 'compare';

include ( './config.php' );
include ( PATH . '/defaults.php' );

// ----------------------------------------------------------------------

// Title tag content
$title = $conf['website_name_short'];

// Template header
include ( PATH . '/templates/' . $cookie_template . '/header.php' );

echo table_header($lang['Compare_Header']);

echo $lang['Compare_Intro'];

echo table_footer();

echo table_header($lang['Package_Agent']);

echo '

<table width="100%" cellpadding="5" cellspacing="0" border="0">
 <tr>
  <td align="center" valign="middle" width="20%" class="header">
   ' . $lang['Admin_Packages_Name'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="header">
   ' . $lang['Admin_Packages_Price'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="header">
   ' . $lang['Admin_Packages_Days'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="header">
   ' . $lang['Admin_Agent_Packages_Listings'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="header">
   ' . $lang['Admin_Agent_Packages_Gallery'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="header">
   ' . $lang['Admin_Agent_Packages_Mainimage'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="header">
   ' . $lang['Admin_Agent_Packages_Photo'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="header">
   ' . $lang['Admin_Agent_Packages_Phone'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="header">
   ' . $lang['Admin_Agent_Packages_Address'] . '
  </td>
 </tr>
';

 $sql = 'SELECT * FROM ' . PACKAGES_AGENT_TABLE . ' ORDER BY price DESC';
 $r = $db->query($sql) or error ('Critical Error', mysql_error () );


  while(  $f = $db->fetcharray($r) )
{
echo '

 <tr>
  <td align="center" valign="middle" width="20%" class="main">
   ' . $f['name'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $f['price'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $f['days'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $f['listings'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $f['gallery'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $f['mainimage'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $f['photo'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $f['phone'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $f['address'] . '
  </td>
 </tr>

';
}

echo '

 <tr>
  <td align="center" valign="middle" width="20%" class="main">
   FREE
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   free
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   lifetime
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $conf['free_listings'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $conf['free_gallery'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $conf['free_mainimage'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $conf['free_photo'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $conf['free_phone'] . '
  </td>
  <td align="center" valign="middle" width="10%" class="main">
   ' . $conf['free_address'] . '
  </td>
 </tr>

';

echo '
</table>
';
echo table_footer();


echo table_header($lang['Package_Listing']);

echo '

<table width="50%" cellpadding="5" cellspacing="0" border="0">
 <tr>
  <td align="center" valign="middle" width="40%" class="header">
   ' . $lang['Admin_Packages_Name'] . '
  </td>
  <td align="center" valign="middle" width="20%" class="header">
   ' . $lang['Admin_Packages_Price'] . '
  </td>
  <td align="center" valign="middle" width="20%" class="header">
   ' . $lang['Admin_Packages_Days'] . '
  </td>
  <td align="center" valign="middle" width="20%" class="header">
   ' . $lang['Listing_Banner'] . '
  </td>
 </tr>
';

 $sql = 'SELECT * FROM ' . PACKAGES_TABLE . ' ORDER BY price DESC';
 $r = $db->query($sql) or error ('Critical Error', mysql_error () );


  while(  $f = $db->fetcharray($r) )
{
echo '

 <tr>
  <td align="center" valign="middle" width="40%" class="main">
   ' . $f['name'] . '
  </td>
  <td align="center" valign="middle" width="20%" class="main">
   ' . $f['price'] . '
  </td>
  <td align="center" valign="middle" width="20%" class="main">
   ' . $f['days'] . '
  </td>
  <td align="center" valign="middle" width="20%" class="main">
   ON
  </td>
 </tr>

';
}
echo '
</table>
';
echo table_footer();

// Template footer
include ( PATH . '/templates/' . $cookie_template . '/footer.php' );

?>